#import "LCTrackQueue.h"

@interface LCTrackQueue ()
@property (nonatomic, strong) NSMutableArray<LCTrackEvent *> *eventQueue;
@end

@implementation LCTrackQueue

+ (instancetype)sharedQueue {
    static LCTrackQueue *queue;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        queue = [[self alloc] init];
    });
    return queue;
}

- (instancetype)init {
    if (self = [super init]) {
        _eventQueue = [NSMutableArray array];
    }
    return self;
}

- (void)enqueueEvent:(LCTrackEvent *)event {
    NSLog(@"[LCAutoTrack] 事件: %@ 参数: %@", event.name, event.params);
    [self.eventQueue addObject:event];
    // TODO: 可拓展为持久化、本地缓存、定时上报等
}

@end